const localCache = {
	setJSON(key, data) {
		uni.setStorage({
			key: key,
			data: data,
			success: () => {
				console.log('缓存:', key, '设置成功');
			},
			fail: () => {
				console.log('缓存:', key, '设置失败');
			}
		});
	},
	getJSON(key) {
		try {
			return uni.getStorageSync(key);
		} catch (e) {
			return undefined
		}
	},
	remove(key) {
		console.log(key,66666666);
		uni.removeStorage({
			key: key,
			success: (res) => {
				console.log('删除缓存:', key, '完成');
			},
			fail: () => {
				console.log('删除缓存:', key, '失败');
			}
		});
	}
}

export default {
	/**
	 * 会话级缓存
	 */
	session: localCache
}